#!/bin/bash

#This script is part of svn-scripts. It is licensed under the GNU GENERAL PUBLIC LICENSE Version 2.
#Check the LICENSE.TXT file included with svn-scripts or check http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt for details.

#Original version: http://mail-archives.apache.org/mod_mbox/db-derby-dev/200808.mbox/%3Cb93df62d0808131732r2c10f271v6d691e4a173fc1c8@mail.gmail.com%3E

#Cleans a subversion repository.
#Requires the subversion-tools package (svn-clean).
if test -z "$1"
then
	#Assume local folder
	echo Reverting...
	svn revert -R . ?> /dev/null

	echo Cleaning...
	svn-clean . ?> /dev/null
	echo -e "Local folder reverted and cleaned."
else
	echo Reverting...
	svn revert -R $1 ?> /dev/null

	echo Cleaning...
	svn-clean $1 ?> /dev/null
	echo -e "$1 reverted and cleaned."
fi
